home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 March / Ahoy_Magazine_87-03_1987_Double_L.d64 / Lights Out (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  198 lines

  1. 4 rem"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]
  2. 5 [143]"(NULL)         lights out!          (NULL)
  3. 6 rem"[221]     by walter e. meyers      [221]
  4. 7 [143]"(NULL)      403 carriage lane       (NULL)
  5. 8 rem"[221]      cary, n.c. 27511        [221]
  6. 9 [143]"/tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantanexp
  7. 10 goto 600
  8. 20 poke 198,0:wait 198,1:ii=peek(631):poke 198,0:return
  9. 30 poke s+5,136:poke s+6,240:poke s+1,20:poke s+4,33:return
  10. 40 poke sc,11:poke bo,11:print"[147]";:for i=0to22:print"  [144]" m$(i):next:return
  11. 50 poke 781,l(r):poke 782,c(r):poke 783,0:sys 65520:print li$(l):li(r)=l
  12. 60 poke lc+r,l:return
  13. 70 for cl=s to s+24:poke cl,0:next:poke s+24,15:return
  14. 80 poke s+6,240:poke s+1,40:poke s+4,17:for t=1to3:next:poke s+4,16:return
  15. 90 poke 781,ln:poke 782,co:poke 783,0:sys 65520:return
  16. 99 :
  17. 100 sc=53281:bo=53280:bn=56576:lc=49244:v=53248:poke v+21,0:s=54272:gosub 70
  18. 110 p0=300:fori=0to9:read c(i),l(i),ho(i),ve(i),vs(i):li(i)=0:next:poke 785,104
  19. 120 poke786,192:fori=1to5:read gh(i):next:for i=0to7:read a:poke 52216+i,a:next
  20. 130 for i=39to46:read a:poke v+i,a:next:for i=4to16:read a:poke v+i,a:next
  21. 140 for i=49256to49275:read a:poke i,a:next:poke v+23,1:poke v+27,2:poke v+29,0
  22. 150 gs=15:gm=1:poke v+21,4:gosub 500:tm=ti
  23. 160 k=1:gr(0)=0:gc=1:pr=0:g=0
  24. 170 n=int(rnd(1)*9+1):gr(k)=n:for i=0tok-1:if gr(k)=gr(i)then 170
  25. 180 next:k=k+1:if k<10 then 170
  26. 190 poke v,ho(pr):poke v+1,ve(pr):poke v+16,vs(pr):poke lc,1:poke v+21,5
  27. 199 :
  28. 200 joy=peek(56320)and15:fire=peek(56320)and16
  29. 210 if joy=11 then if pr<>3andpr<>6andpr<>9 then pr=pr+1:poke 52216,4:goto 260
  30. 220 if joy=14 then if pr<7 then pr=pr+3:goto 260
  31. 230 if joy=13 then if pr>3 then pr=pr-3:goto 260
  32. 240 if joy=7 then if pr<>7andpr<>4andpr<>1 then pr=pr-1:poke 52216,3:goto 260
  33. 250 if fire=0 then if pr>0 then r=pr:l=1:gosub 50:gosub 80
  34. 260 win=usr(0):if win=1 then poke v+21,5:goto 400
  35. 270 gosub 300:for t=1to40:next:poke v,ho(pr):poke v+1,ve(pr):poke v+16,vs(pr)
  36. 280 goto 200
  37. 299 :
  38. 300 gc=gc+1:if gc<gs then return
  39. 310 gc=1:g=g+1:if g=10 then g=1
  40. 320 poke v+2,ho(gr(g)):poke v+3,ve(gr(g))+14:poke v+21,7:r=gr(g)
  41. 330 l=0:gosub 50:gosub 30:return
  42. 399 :
  43. 400 gm=gm+1:if gm>5 then 430
  44. 410 gs=gs-2:poke v+40,gh(gm):poke sc,gh(gm):poke bo,gh(gm):for i=1to10:next
  45. 420 poke sc,11:poke bo,11:l=0:for r=1to9:gosub 50:next:goto 160
  46. 429 :
  47. 430 p1=(ti-tm)/60:p2=int(p1/60):p3=int(p1-(p2*60)):ln=21:co=5:gosub 90
  48. 440 poke 52216,5:print"your time:" p2 "min.," p3 "sec.":if p1<p0 then p0=p1
  49. 450 b2=int(p0/60):b3=int(p0-(b2*60)):ln=22:co=5:gosub 90:print"best time:";
  50. 460 print b2 "min.," b3 "sec.":ln=23:co=2:gosub 90:print"hit q to quit, ";
  51. 470 print"any other key to play.":gosub 20:poke v+21,0:if ii=81 then 490
  52. 480 goto 150
  53. 490 poke 648,4:poke 53272,21:poke bn,199:poke sc,6:poke bo,14:print"[147][154]":end
  54. 499 :
  55. 500 print"[147]":poke bn,peek(bn)and 252:poke 648,200:gosub 40:poke v+24,44
  56. 510 for t=1to2000:next:r=9:l=0:poke s+5,6:poke s+6,255:poke s+4,23:vo=15
  57. 520 fork=1to5:f1=20:poke s+24,2:f1=20:poke s+24,2:for j=1to6:poke s+24,vo:f2=20
  58. 530 poke s+1,f1:for i=1to4:poke s+15,f2:f2=f2*1.02:next:f1=f1*1.2:vo=vo-2:next
  59. 540 gosub 50:poke v+21,6:poke v+2,ho(r):poke v+3,ve(r)+14:r=r-1:poke s+24,15
  60. 550 for j=1to8:f2=20:poke s+1,f1:for i=1to3:poke s+15,f2:f2=f2/1.2:next
  61. 570 f1=f1/1.5:next:vo=15:if r>0thengosub50:pokev+2,ho(r):pokev+3,ve(r)+14:r=r-1
  62. 580 next:poke s+6,15:gosub 70:poke v+21,254:for k=1to30:for j=6to14step2
  63. 590 poke v+j,int(rnd(1)*(255-40)+40):poke v+j+1,int(rnd(1)*(200-50)+50)
  64. 595 next:next:poke v+21,4:poke 52216,4:return
  65. 600 poke 53281,15:print"[147][144] insert a joystick in port two. hit any "
  66. 610 printtab(12)"key when ready.":gosub 20
  67. 620 j=56334:for i=49152to49184:read a:poke i,a:next:poke j,peek(j)and 254
  68. 630 poke 1,peek(1)and 251:sys 49152:poke 1,peek(1)or 4:poke j,peek(j)or 1
  69. 640 read a:if a=-1 then 660
  70. 650 for i=0to7:read b:poke 61440+a*8+i,b:next:goto 640
  71. 660 for i=0to319:read a:poke 49344+i,a:next
  72. 699 :
  73. 700 dim m$(23),in$(4):m$(0)="[157][][][][][][][][][][][][][][][]":m$(2)=m$(0)
  74. 710 m$(1)="[157]][][][][][][][][][][][][][][]["
  75. 720 m$(3)="[144][201][202][193][194][195][196][197][198][202][202][202][193][194][195][196][197][198][202][202][202][193][194][195][196][197][198][202][203]"
  76. 730 m$(4)="[201][202][199][158] [162]  [144][200][202][202][202][199][158] [172][187] [144][200][202][202][202][199][158][172][162][162][187][144][200][202][203]"
  77. 740 m$(5)="[201][202][199][158] @  [144][200][202][202][202][199][158] [146][161][161] [144][200][202][202][202][199][158][146][161][161][188][190][144][200][202][203]"
  78. 750 m$(6)="[201][202][199][158] @  [144][200][202][202][202][199][158] [146][161][161] [144][200][202][202][202][199][158][146][161][161][146][187][161][144][200][202][203]"
  79. 760 m$(7)="[201][202][199][158] [146][162][162] [144][200][202][202][202][199][158] [188][190] [144][200][202][202][202][199][158][188][146][162][162][190][144][200][202][203]"
  80. 770 m$(8)="[201][202][208][209][209][209][209][210][201][202][203][208][209][209][209][209][210][201][202][203][208][209][209][209][209][210][202][203]":m$(9)=m$(3)
  81. 780 m$(10)="[201][202][199][158][172][187][172][187][144][200][202][202][202][199][158][172][162][162][187][144][200][202][202][202][199][158][172][162][162][187][144][200][202][203]"
  82. 790 m$(11)="[201][202][199][158][146][161][188][190][161][144][200][202][202][202][199][158] [146][161][161] [144][200][202][202][202][199][158][146][161][188][162][187][144][200][202][203]"
  83. 800 m$(12)="[201][202][199][158][146][161][161][146][161][161][144][200][202][202][202][199][158] [146][161][161] [144][200][202][202][202][199][158]  [146][161][161][144][200][202][203]"
  84. 810 m$(13)="[201][202][199][158][188][190][188][190][144][200][202][202][202][199][158] [188][190] [144][200][202][202][202][199][158][188][146][162][162][190][144][200][202][203]"
  85. 820 m$(14)="[201][202][208][209][209][209][209][210][201][202][203][208][209][209][209][209][210][201][202][203][208][209][209][209][209][210][202][203][][][][]"
  86. 830 m$(15)="[144][201][202][193][194][195][196][197][198][202][202][202][193][194][195][196][197][198][202][202][202][193][194][195][196][197][198][202][203]][][][]["
  87. 840 m$(16)="[201][202][199][158][172][162][162][187][144][200][202][202][202][199][158][172][187][172][187][144][200][202][202][202][199][158][172][162][162][187][144][200][202][203][213][214][146]  [215][216][200]"
  88. 850 m$(17)="[201][202][199][158][146][161][161][146][161][161][144][200][202][202][202][199][158][146][161][161][146][161][161][144][200][202][202][202][199][158] [146][161][161] [144][200][202][203][146]      [200]"
  89. 860 m$(18)=m$(17):m$(19)="[201][202][199][158][188][146][162][162][190][144][200][202][202][202][199][158][188][146][162][162][190][144][200][202][202][202][199][158] [188][190] [144][200][202][203][146]      [200]"
  90. 870 m$(20)=m$(8)+"[211][211][211][211][211][211][200]":m$(21)="[201][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][203][212][212][212][212][212][212][200]"
  91. 880 m$(22)="[201][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][202][203]"+"       [184]"
  92. 890 l$="[][][157][157][157][157]<><>[157][157][157][157][][][157][157][157][157]<><>":li$(0)="[146][144]"+l$:li$(1)="[158]"+l$:goto100
  93. 899 :
  94. 900 data 169,0,133,251,133,253,169,208,133,252,169,240,133,254,162,16,160
  95. 901 data 0,177,251,145,253,136,208,249,230,252,230,254,202,208,240,96
  96. 907 :
  97. 1000 data 0,255,255,255,255,255,255,255,255
  98. 1001 data 27,255,128,128,128,128,128,128,128
  99. 1002 data 29,255,1,1,1,1,1,1,1
  100. 1003 data 60,128,128,128,128,128,128,128,128
  101. 1004 data 62,1,1,1,1,1,1,1,1
  102. 1005 data 128,0,0,0,0,0,0,0,0
  103. 1006 data 155,0,127,127,127,127,127,127,127
  104. 1007 data 157,0,254,254,254,254,254,254,254
  105. 1008 data 158,255,231,195,129,231,231,231,103
  106. 1009 data 188,127,127,127,127,127,127,127,127
  107. 1010 data 190,254,254,254,254,254,254,254,254
  108. 1011 data 193,0,255,14,240,199,159,62,0
  109. 1012 data 194,15,240,7,254,252,0,127,0
  110. 1013 data 195,128,60,249,3,243,121,28,0
  111. 1014 data 196,1,60,159,192,207,158,56,0
  112. 1015 data 197,240,15,224,127,63,0,254,0
  113. 1016 data 198,0,255,112,15,227,249,124,0
  114. 1017 data 199,140,206,134,150,146,154,152,156
  115. 1018 data 200,49,115,97,105,73,89,25,57
  116. 1019 data 201,0,127,0,255,255,255,255,255
  117. 1020 data 202,0,255,0,255,255,255,255,255
  118. 1021 data 203,0,254,0,255,255,255,255,255
  119. 1022 data 208,0,63,159,192,255,255,255,255
  120. 1023 data 209,0,255,255,0,255,255,255,255
  121. 1024 data 210,0,252,249,3,255,255,255,255
  122. 1025 data 211,255,255,255,60,60,24,60,60
  123. 1026 data 212,126,126,126,60,60,24,60,255
  124. 1027 data 213,255,135,156,176,224,240,240,224
  125. 1028 data 214,254,128,0,0,0,0,0,0
  126. 1029 data 215,127,1,0,0,0,0,0,0
  127. 1030 data 216,255,225,57,13,7,15,15,7
  128. 1031 data -1
  129. 1099 :
  130. 1100 data 0,0,0,0,0,0,0,0,0
  131. 1101 data 0,0,0,0,0,0,0,0,0
  132. 1102 data 0,0,0,0,0,0,0,0,0
  133. 1103 data 0,0,0,1,255,192,3,255,224
  134. 1104 data 3,255,240,1,255,192,1,254,0
  135. 1105 data 7,255,192,15,255,224,15,255,240
  136. 1106 data 15,255,240,7,255,240,3,255,224,0
  137. 1109 :
  138. 1110 data 0,0,0,0,0,0,0,0,0
  139. 1111 data 0,0,0,0,0,0,0,0,0
  140. 1112 data 0,0,0,0,0,0,0,0,0
  141. 1113 data 0,0,0,3,255,128,7,255,192
  142. 1114 data 15,255,192,3,255,128,0,127,128
  143. 1115 data 3,255,224,7,255,240,15,255,240
  144. 1116 data 15,255,240,15,255,224,7,255,192,0
  145. 1119 :
  146. 1120 data 0,0,0,0,0,0,0,0,0
  147. 1121 data 0,0,0,0,0,0,0,254,0
  148. 1122 data 1,255,0,15,165,240,62,0,124
  149. 1123 data 120,0,30,248,255,31,249,255,159
  150. 1124 data 253,255,191,124,255,62,62,126,124
  151. 1125 data 63,255,252,31,255,248,15,255,240
  152. 1126 data 15,255,240,15,255,240,7,255,224,0
  153. 1129 :
  154. 1130 data 0,126,0,1,255,128,7,255,224
  155. 1131 data 15,255,240,28,24,56,30,24,120
  156. 1132 data 31,153,248,25,255,152,28,126,56
  157. 1133 data 30,0,120,31,0,248,15,129,240
  158. 1134 data 15,231,240,7,255,224,7,255,224
  159. 1135 data 3,255,192,3,255,192,1,255,128
  160. 1136 data 0,255,0,0,126,0,0,24,0,0
  161. 1139 :
  162. 1140 data 1,255,128,7,255,224,31,255,248
  163. 1141 data 63,255,252,127,255,254,127,255,254
  164. 1142 data 255,255,255,255,255,255,255,255,255
  165. 1143 data 255,255,255,255,255,255,127,255,254
  166. 1144 data 127,255,254,63,255,252,31,255,248
  167. 1145 data 7,255,224,1,255,128,0,0,0
  168. 1146 data 0,0,0,0,0,0,0,0,0,0
  169. 1199 :
  170. 1200 data 30,16,16,169,5, 23,16,213,169,4, 14,16,140,169,4, 5,16,67,169,4
  171. 1201 data 23,10,213,121,4, 14,10,140,121,4, 5,10,67,121,4, 23,4,213,73,4
  172. 1202 data 14,4,140,73,4, 5,4,67,73,4
  173. 1209 :
  174. 1210 data 3,10,13,14,1,6,6,7,6,6,6,6,6,0,3,15,8,10,14,13,7
  175. 1219 :
  176. 1220 data 60,65,12,65,60,60,140,121,140,121,140,121,4
  177. 1229 :
  178. 1230 data 160,0,185,93,192,240,12,200,192,9,208,246,160,1,169,0,108,5,0,96
  179. 4999 :
  180. 5000 cc=0:for i=49152to49184:read a:cc=cc+a:next
  181. 5010 if cc<>5966 then print"error in lines 900-901":stop
  182. 5020 print"font loader ok":cc=0
  183. 5030 read a:cc=cc+a:if a=-1 then 5050
  184. 5040 goto 5030
  185. 5050 if cc<>37856 then print"error in lines 1000-1031":stop
  186. 5060 print"character data ok":for i=0to4:cc(i)=0:next
  187. 5070 cs(0)=5083:cs(1)=4895:cs(2)=7035:cs(3)=6822:cs(4)=10317
  188. 5080 for j=0to4:for i=0to63
  189. 5090 read a:cc(j)=cc(j)+a:next
  190. 5100 next:for i=0to4
  191. 5110 if cc(i)<>cs(i) then print"error in lines"1100+i*10"to"1106+i*10:stop
  192. 5120 print"sprite"i+1"ok"
  193. 5130 next:cc=0
  194. 5140 for i=1to104
  195. 5150 read a:cc=cc+a
  196. 5160 next:if cc<>6382 then print"error in lines 1200-1230":stop
  197. 5170 print"all data ok"
  198.